﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:Models="clr-namespace:CI.Models;assembly=CI.Models" 
                    xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
                    xmlns:ModelsData="clr-namespace:CI.Models.Data;assembly=CI.Models" 
                    xmlns:Tools="clr-namespace:CI.Utility" 
                    xmlns:ViewModels="clr-namespace:CI.ViewModels" 
                    xmlns:Diagramming="clr-namespace:CI.ViewModels.Diagramming"
                    xmlns:Commerce="clr-namespace:CI.ViewModels.Commerce">
    <Tools:CharacterPortraitConverter x:Key="CharacterPortraitConverter"/>
    <DataTemplate DataType="{x:Type Diagramming:CharacterVertexViewModel}" >
        <Grid dd:DragDrop.IsDropTarget="True" dd:DragDrop.DropHandler="{Binding}">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Image Stretch="UniformToFill" Source="{Binding Path=Character.ID, Converter={StaticResource CharacterPortraitConverter}}" Height="128" Width="128"/>
            <TextBlock HorizontalAlignment="Center" Grid.Row="1" FontSize="32" FontWeight="DemiBold" Text="{Binding Path=Character.Name, Mode=OneTime}"/>
        </Grid>
    </DataTemplate>
    <DataTemplate DataType="{x:Type Diagramming:CorporationVertexViewModel}">
        <Grid dd:DragDrop.IsDropTarget="True" dd:DragDrop.DropHandler="{Binding}">
            <Grid.RowDefinitions>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="1" FontSize="32" FontWeight="DemiBold" Text="{Binding Path=Corporation.Name}"/>
        </Grid>
    </DataTemplate>
    <DataTemplate DataType="{x:Type Commerce:BuyItemsVertexViewModel}">
        <Grid dd:DragDrop.IsDropTarget="True" dd:DragDrop.DropHandler="{Binding}">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="1" FontSize="32" FontWeight="DemiBold" Text="Buy Items"/>
            <DataGrid Grid.Row="1" Grid.Column="1" ItemsSource="{Binding Path=Job.Items}" AutoGenerateColumns="False">
            	<DataGrid.Columns>
            		<DataGridTextColumn Binding="{Binding Path=Item.TypeName}" Header="Name" IsReadOnly="True"/>
            		<DataGridTextColumn Binding="{Binding Path=Total}" Header="Quantity"/>
            	</DataGrid.Columns>
            </DataGrid>
        </Grid>
    </DataTemplate>
</ResourceDictionary>